package com.google.gwt.chart.client;

import com.google.gwt.widgetideas.graphics.client.*;
import com.google.gwt.dom.client.*;

//=========================================================================
/**
 * Title:        PlotOptions <br>
 * Description:  $defaultDesc$<br>
 * Copyright:    Apache Public License 2.0<br>
 * Company:      $company$<br>
 * @author James Hutton
 */
//=========================================================================
public class PlotOptions {

	//Legend Options
	//=========================================================================
	/**
	 * Title:        LegendOptions <br>
	 * Description:  $defaultDesc$<br>
	 * Copyright:    Apache Public License 2.0<br>
	 * Company:      $company$<br>
	 * @author James Hutton
	 */
	//=========================================================================
	public static class LegendOptions {

		/** Field: show          */
		public boolean show = true;
		/** Field: noColumns          */
		public int noColumns = 1;
		/** Field: labelFormatter          */
		public AnnotationFormatter<String> labelFormatter = new AnnotationFormatter<String>() {

			public String format(String string) {
				return string;
			}

		};
		/** Field: labelBoxBorderColor          */
		public Color labelBoxBorderColor = new Color("#ccc");
		/** Field: container          */
		public Element container = null;
		/** Field: position          */
		public Direction position = Direction.NE;
		/** Field: backgroundColor          */
		public Color backgroundColor = null;
		/** Field: backgroundOpacity          */
		public double backgroundOpacity = 0.85;

	}
	//Axis Options
	//=========================================================================
	/**
	 * Title:        AxisOptions <br>
	 * Description:  $defaultDesc$<br>
	 * Copyright:    Apache Public License 2.0<br>
	 * Company:      $company$<br>
	 * @author James Hutton
	 */
	//=========================================================================
	public static class AxisOptions {

		/** Field: ticks          */
		public Ticks ticks = null;
		/** Field: noTicks          */
		public int noTicks = 5;
		/** Field: tickFormatter          */
		public AnnotationFormatter<java.lang.Number> tickFormatter = new AnnotationFormatter<Number>() {

			public String format(Number number) {
				return number.toString();
			}

		};
		/** Field: tickDecimals          */
		public Number tickDecimals = null;
		/** Field: min          */
		public Number min = null;
		/** Field: max          */
		public Number max = null;
		/** Field: autoscaleMargin          */
		public double autoscaleMargin = 0;

	}
	//Points Options
	//=========================================================================
	/**
	 * Title:        PointsOptions <br>
	 * Description:  $defaultDesc$<br>
	 * Copyright:    Apache Public License 2.0<br>
	 * Company:      $company$<br>
	 * @author James Hutton
	 */
	//=========================================================================
	public static class PointsOptions {

		/** Field: show          */
		public boolean show = false;
		/** Field: radius          */
		public int radius = 3;
		/** Field: lineWidth          */
		public int lineWidth = 2;
		/** Field: fill          */
		public boolean fill = true;
		/** Field: fillColor          */
		public Color fillColor = new Color("#ffffff");

	}
	//Pie Options
	//=========================================================================
	/**
	 * Title:        PieOptions <br>
	 * Description:  $defaultDesc$<br>
	 * Copyright:    Apache Public License 2.0<br>
	 * Company:      $company$<br>
	 * @author James Hutton
	 */
	//=========================================================================
	public static class PieOptions {
		public boolean show = false;
		/**
		 * The ratio of the chart's width to offset annotations from the center.
		 * This defaults to 0.25.
		 */
		public double annotationOffsetRatio = .25;
		
		public int borderWidth = 1;
		
		public boolean fill = true;
		
		public boolean showAsPercentage = true;
		
	}
	//Lines Options
	//=========================================================================
	/**
	 * Title:        LinesOptions <br>
	 * Description:  $defaultDesc$<br>
	 * Copyright:    Apache Public License 2.0<br>
	 * Company:      $company$<br>
	 * @author James Hutton
	 */
	//=========================================================================
	public static class LinesOptions {

		/** Field: show          */
		public boolean show = false;
		/** Field: lineWidth          */
		public int lineWidth = 2;
		/** Field: fill          */
		public boolean fill = false;
		/** Field: fillColor          */
		public Color fillColor = null;

	}
	//Bar Options
	//=========================================================================
	/**
	 * Title:        BarOptions <br>
	 * Description:  $defaultDesc$<br>
	 * Copyright:    Apache Public License 2.0<br>
	 * Company:      $company$<br>
	 * @author James Hutton
	 */
	//=========================================================================
	public static class BarOptions {

		/** Field: show          */
		public boolean show = false;
		/** Field: lineWidth          */
		public int lineWidth = 2;
		/** Field: barWidth          */
		public int barWidth = 1;
		/** Field: fill          */
		public boolean fill = true;
		/** Field: fillColor          */
		public Color fillColor = null;

	}
	//Grid Options
	//=========================================================================
	/**
	 * Title:        GridOptions <br>
	 * Description:  $defaultDesc$<br>
	 * Copyright:    Apache Public License 2.0<br>
	 * Company:      $company$<br>
	 * @author James Hutton
	 */
	//=========================================================================
	public static class GridOptions {

		/** Field: color          */
		public Color color = new Color("#545454");
		/** Field: backgroundColor          */
		public Color backgroundColor = null;
		/** Field: tickColor          */
		public Color tickColor = new Color("#dddddd");
		/** Field: labelMargin          */
		public int labelMargin = 3;

	}
	//Selection Options
	//=========================================================================
	/**
	 * Title:        SelectionOptions <br>
	 * Description:  $defaultDesc$<br>
	 * Copyright:    Apache Public License 2.0<br>
	 * Company:      $company$<br>
	 * @author James Hutton
	 */
	//=========================================================================
	public static class SelectionOptions {

		/** Field: mode          */
		public SelectionMode mode = null;
		/** Field: color          */
		public Color color = new Color("#B6D9FF");
		/** Field: fps          */
		public int fps = 10;

	}
	//Mouse Options
	//=========================================================================
	/**
	 * Title:        MouseOptions <br>
	 * Description:  $defaultDesc$<br>
	 * Copyright:    Apache Public License 2.0<br>
	 * Company:      $company$<br>
	 * @author James Hutton
	 */
	//=========================================================================
	public static class MouseOptions {

		/** Field: track          */
		public boolean track = false;
		/** Field: position          */
		public Direction position = Direction.SE;
		/** Field: trackFormatter          */
		public AnnotationFormatter trackFormatter = null;
		/** Field: margin          */
		public int margin = 3;
		/** Field: color          */
		public Color color = new Color("#ff3f19");
		/** Field: trackDecimals          */
		public int trackDecimals = 1;
		/** Field: sensibility          */
		public int sensibility = 2;
		/** Field: radius          */
		public int radius = 3;

	}
	//General Options
	/** Field: shadowSize          */
	public int shadowSize = DEFAULT_SHADOWSIZE;
	/** Field: DEFAULT_SHADOWSIZE          */
	public static final int DEFAULT_SHADOWSIZE = 4;
	/** Field: legend          */
	public LegendOptions legend = new LegendOptions();
	/** Field: xaxis          */
	public AxisOptions xaxis = new AxisOptions();
	/** Field: yaxis          */
	public AxisOptions yaxis = new AxisOptions();
	/** Field: grid          */
	public GridOptions grid = new GridOptions();
	/** Field: selection          */
	public SelectionOptions selection = new SelectionOptions();
	/** Field: mouse          */
	public MouseOptions mouse = new MouseOptions();
	/** Field: points          */
	public PointsOptions points = new PointsOptions();
	/** Field: lines          */
	public LinesOptions lines = new LinesOptions();
	/** Field: bar          */
	public BarOptions bar = new BarOptions();

	public PieOptions pie = new PieOptions();
}

